﻿using MiniExcelLibs.Attributes;

namespace JinYuan.Models
{
    /// <summary>
    /// 变量属性类
    /// </summary>
    public class Variable
    {
        /// <summary>
        /// 变量名称
        /// </summary>
        public string VarName { get; set; }

        /// <summary>
        /// 变量地址
        /// </summary>
        public string VarAddress { get; set; }
        /// <summary>
        /// 起始索引
        /// </summary>
        public string Start { get; set; }
        /// <summary>
        /// 数据类型
        /// </summary>
        public string DataType { get; set; }
        /// <summary>
        /// 偏移或长度
        /// </summary>
        public int OffsetOrLenght { get; set; }
        /// <summary>
        /// 所属通信组名称
        /// </summary>
        public string GroupName { get; set; }
        /// <summary>
        /// 备注说明
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 是否上升沿报警
        /// </summary>
        public bool PosAlarm { get; set; }
        /// <summary>
        /// 是否下降沿报警
        /// </summary>
        public bool NegAlarm { get; set; }
        /// <summary>
        /// 转换系数
        /// </summary>
        public float Scale { get; set; } = 1.0f;
        /// <summary>
        /// 偏移值
        /// </summary>
        public float Offset { get; set; } = 0.0f;

        /// <summary>
        /// 变量的值
        /// </summary>
        [ExcelIgnore]
        public object VarValue { get; set; }

        /// <summary>
        /// 高报警启用
        /// </summary>
        public bool HighAlarmEnable { get; set; }

        /// <summary>
        /// 高报警设定值
        /// </summary>
        public float HighAlarmValue { get; set; }

        /// <summary>
        /// 高报警说明
        /// </summary>
        public string HighAlarmNote { get; set; }

        /// <summary>
        /// 高报警缓存值
        /// </summary>
        [ExcelIgnore]
        public float HighAlarmCacheValue { get; set; }
        /// <summary>
        /// 低报警启用
        /// </summary>
        public bool LowAlarmEnable { get; set; }

        /// <summary>
        /// 低报警设定值
        /// </summary>
        public float LowAlarmValue { get; set; }

        /// <summary>
        /// 低报警说明
        /// </summary>
        public string LowAlarmNote { get; set; }

        /// <summary>
        /// 低报警缓存值
        /// </summary>
        [ExcelIgnore]
        public float LowAlarmCacheValue { get; set; }
    }
}
